﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DigitalSolutionControls
{
    public partial class ListPanel : UserControl
    {
        public event EventHandler AddClick;
        public event EventHandler EditClick;
        public event EventHandler DeleteClick;
        public event EventHandler ViewClick;

        public string TextAdd 
        { 
            get
            {
                return toolStripButtonAdd.Text;
            }
            set
            {
                toolStripButtonAdd.Text = value;
            }
        }

        public string TextView
        {
            get
            {
                return toolStripButtonView.Text;
            }
            set
            {
                toolStripButtonView.Text = value;
            }
        }

        public string TextEdit
        {
            get
            {
                return toolStripButtonEdit.Text;
            }
            set
            {
                toolStripButtonEdit.Text = value;
            }
        }

        public string TextDelete
        {
            get
            {
                return toolStripButtonDelete.Text;
            }
            set
            {
                toolStripButtonDelete.Text = value;
            }
        }

        public bool EnableAdd
        {
            get
            {
                return toolStripButtonAdd.Enabled;
            }
            set
            {
                toolStripButtonAdd.Enabled = value;
            }
        }

        public bool EnableView
        {
            get
            {
                return toolStripButtonView.Enabled;
            }
            set
            {
                toolStripButtonView.Enabled = value;
            }
        }

        public bool EnableEdit
        {
            get
            {
                return toolStripButtonEdit.Enabled;
            }
            set
            {
                toolStripButtonEdit.Enabled = value;
            }
        }

        public bool EnableDelete
        {
            get
            {
                return toolStripButtonDelete.Enabled;
            }
            set
            {
                toolStripButtonDelete.Enabled = value;
            }
        }

        public bool VisibleAdd
        {
            get
            {
                return toolStripButtonAdd.Visible;
            }
            set
            {
                toolStripButtonAdd.Visible = value;
            }
        }

        public bool VisibleView
        {
            get
            {
                return toolStripButtonView.Visible;
            }
            set
            {
                toolStripButtonView.Visible = value;
            }
        }

        public bool VisibleEdit
        {
            get
            {
                return toolStripButtonEdit.Visible;
            }
            set
            {
                toolStripButtonEdit.Visible = value;
            }
        }

        public bool VisibleDelete
        {
            get
            {
                return toolStripButtonDelete.Visible;
            }
            set
            {
                toolStripButtonDelete.Visible = value;
            }
        }

        public ListPanel()
        {
            InitializeComponent();
        }

        private void toolStripButtonAdd_Click(object sender, EventArgs e)
        {
            if (AddClick != null)
                AddClick(sender, e);
        }

        private void toolStripButtonEdit_Click(object sender, EventArgs e)
        {
            if (EditClick != null)
                EditClick(sender, e);
        }

        private void toolStripButtonDelete_Click(object sender, EventArgs e)
        {
            if (DeleteClick != null)
                DeleteClick(sender, e);
        }

        private void toolStripButtonView_Click(object sender, EventArgs e)
        {
            if (ViewClick != null)
                ViewClick(sender, e);
        }
    }
}
